home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Can anyone optimize this VERY simple piece of code?
- Date: Tue, 20 Feb 96 18:56:25 GMT
- Organization: none
- Message-ID: <824842585snz@genesis.demon.co.uk>
- References: <19950700wnr@samtech.demon.co.uk> <31276E30.26C0@ix.netcom.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <31276E30.26C0@ix.netcom.com>
- hcross@ix.netcom.com "Henry Cross" writes:
-
- >> Personally I'd use a VERY simple language. Assembly!
- > This is a job for inline assembly, compiler allowing, or an assembler
- >if not.
- > However if you must persist in C, use pointers every place possible.
-
- This hasn't been the case in any reasonable compiler for a number of years
- now.
-
- > For example vgamem[count] could be a pointer that incremented++ vice
- > an index to an array. (Which is very expensive computationally.)
-
- The strength reduction required to convert an index to a pointer is one
- of the simpler optimistaion that compilers perform. Code that uses indices
- often provides more information to the compiler for optimisation purposes so
- may even result in better code generated.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-